package com.hnust.api;


import com.github.lianjiatech.retrofit.spring.boot.annotation.RetrofitClient;
import com.hnust.domain.*;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import retrofit2.Call;
import retrofit2.http.*;

import java.util.List;
@Component
@RetrofitClient(baseUrl = "${feign.baseUrl}",readTimeoutMs = 50000,writeTimeoutMs = 50000,connectTimeoutMs = 50000)
public interface GradeListApi {
    @GET("/mock/418628/teacher/reportResults")
    Call<Result<List<GradeList>>> reportResults(@Query("examCourseId") String examCourseId, @Query("classId") String classId);

    //获取考试班级
    @GET("/api/paperResult/getClassName")
    Call<Result<List<ClassNameAndID>>> getClassName(@Query("examId") String examId);

    //获取班级的成绩单
    @GET("/api/paperResult/getClassGrade")
    Call<Result<List<StudentGradReport>>> getClassGrade(@Query("examId") String examId, @Query("classId") String classId);

    //下载试卷WORD
    @GET("/download/paperdocx")
    Call<ResponseBody> getPaperDocx(@Query("paperId") String paperId);

    //获取考试名称
    @GET("/api/paperResult/getTestName")
    Call<Result<String>> getTestName(@Query("testid") String testid);

    //导出学生成绩单
    @Multipart
    @POST("/download/exportExcel")
    Call<ResponseBody> getScoreList(@Part("ssl") RequestBody ssl);
}
